package wu.example.orderserver.lb;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.RpcException;
import org.apache.dubbo.rpc.cluster.LoadBalance;

import java.util.List;

/**
 * @author benjamin_5
 * @Description
 * @date 2024/8/23
 */
public class WuLoadBalance implements LoadBalance {

    public final static String NAME = "wu";

    @Override
    public <T> Invoker<T> select(List<Invoker<T>> invokers, URL url, Invocation invocation) throws RpcException {
        System.out.println("执行负载均衡");
        return invokers.get(0);
    }
}
